package com.example.semo.controller;

import com.example.semo.dao.SwiperDao;
import com.example.semo.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@ResponseBody
public class SwiperControllew {
    String msg;
    int code;
    @Autowired
    SwiperDao swiperDao;
    @RequestMapping("/selectSwiper")
    public JsonResult selectSwiper(){
        List list=swiperDao.SelectSwiper();
        if(list==null||list.size()==0){
            code=500;
            msg="数据为空";
        }else {
            code=200;
            msg="轮播图列表查询成功";
        }
        return new JsonResult(code,msg,list);
    }
}
